package com.lnsf.bookstore.system.specification.service.impl;

import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.specification.dao.SpecificationMapper;
import com.lnsf.bookstore.system.specification.vo.Specification;
import com.lnsf.bookstore.system.specification.service.SpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class SpecificationServiceImpl implements SpecificationService {

    @Autowired
    private SpecificationMapper specificationMapper;


    @Override
    public int save(Specification specification) {
        return specificationMapper.insertSelective(specification);
    }

    @Override
    public Specification queryObject(Integer id) {
        return specificationMapper.queryObject(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return specificationMapper.deleteBatch(ids);
    }

    @Override
    public int update(Specification specification) {
        return specificationMapper.updateByPrimaryKeySelective(specification);
    }

    @Override
    public PageInfo<Specification> queryList(Map<String, Object> params) {
        return new PageInfo<Specification>(specificationMapper.queryList(params));
    }
}
